package blog.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import blog.entity.Menu;
import blog.mapper.MenuMapper;
import blog.service.MenuService;

@Service
public class MenuServiceImpl implements MenuService {
	
	@Autowired
	private MenuMapper menuMapper;
	/**
	 * 查询所有菜单信息
	 */
	public List<Menu> findAllMenu() {
		return menuMapper.findAllMapper();
	}
	/**
	 * 添加菜单
	 * @param menu
	 */
	public void addMenu(Menu menu) {
		menuMapper.addMenu(menu);
	}
	
	/**
	 * 根据id删除菜单
	 * @param id
	 */
	public void deleteMenu(Integer id) {
		menuMapper.deleteMenu(id);
	}
	/**
	 * 根据id查询菜单
	 * @param id
	 * @return
	 */
	public Menu getMenuById(Integer id) {
		return menuMapper.getMenuById(id);
	}
	/**
	 * 更新菜单
	 * @param menu
	 */
	public void updateMenu(Menu menu) {
		menuMapper.updateMenu(menu);
	}
	
}
